isExistNewVersion(curVersion)
{
	FileDelete, %A_Temp%/TomcatTool_version.txt 
	UrlDownloadToFile, http://mxstrive-oss.oss-cn-beijing.aliyuncs.com/tomcattool/version.txt, %A_Temp%/TomcatTool_version.txt 
	FileReadLine, versionStr, %A_Temp%/TomcatTool_version.txt , 1
	StringTrimLeft, version, versionStr, 19
	return curVersion < version
}

downloadNewVersion()
{
	msgbox, 4, 提示, 发现新版本，是否更新, %A_ScriptFullPath%
	IfMsgBox Yes
	{
		FileMove, %A_ScriptFullPath%, tmpFile, 1
		UrlDownloadToFile, http://mxstrive-oss.oss-cn-beijing.aliyuncs.com/tomcattool`%2FTomcatTool.exe, TomcatTool.exe
		if !ErrorLevel
		{
			Run, TomcatTool.exe
			exitapp
		}
	}
}

updateTool(curVersion)
{
	isExistNewVer := isExistNewVersion(curVersion)
	if isExistNewVer
		downloadNewVersion()
}
